<?php
require_once '../Config.php';
$con = mysql_connect ( host, username, password );
if (! $con) {
	die ( 'Could not connect: ' . mysql_error () );
}
mysql_select_db ( db, $con );
$arr = array();
//1:银行贷款  2：信用卡申请
$type = $_REQUEST['type'];
$sql = "set names utf8";
mysql_query($sql);
$sql = "select * from j_tab_model where type=".$type ." order by id";
$result = mysql_query($sql);
if(empty($result)){
	$json = json_encode($arr);
	echo $json;
}else{
	$i=0;
	while($row=mysql_fetch_array($result)){
		$id = $row['id'];
		$icon = ip.project.$row['icon'];
		$name = $row['name'];
		$type = $row['type'];
		$isPhone = $row['isPhone'];
		$link = $row['link'];
		$arr[$i]['id'] = $id;
		$arr[$i]['icon'] = $icon;
		$arr[$i]['name'] = $name;
		$arr[$i]['type'] = $type;
		$arr[$i]['isPhone'] = $isPhone;
		$arr[$i]['link'] = $link;
		$i ++;
	}
	$json = json_encode($arr);
	echo $json;
}
?>